package cn.bdqn.service.impl;

import cn.bdqn.mapper.VideoMapper;
import cn.bdqn.pojo.Video;
import cn.bdqn.service.VideoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class VideoServiceImpl implements VideoService {

    @Resource
    VideoMapper videoMapper;


    @Override
    public List<Video> selectAll(String category, Long languageId, Integer pageNo, Integer pageSize) {
       int page=(pageNo-1)*pageSize;
        return videoMapper.selectAll(category,languageId,page,pageSize);
    }

    @Override
    public int selectCount(String category, Long languageId) {
        return videoMapper.selectCount(category,languageId);
    }

    @Override
    public int insert(Video video) {
        return videoMapper.insert(video);
    }

    @Override
    public Video selectOne(Long id) {
        return videoMapper.selectOne(id);
    }

    @Override
    public int update(Video video) {
        return videoMapper.update(video);
    }

    @Override
    public int delete(Long id) {
        return videoMapper.delete(id);
    }
}
